package org.argeproje.resim.proc.math;



import org.argeproje.resim.proc.FunctionPR;
import org.argeproje.resim.proc.PerPixelFunctionI;
import org.argeproje.resim.proc.data.Data;
import org.argeproje.resim.proc.data.ImageDA;



public class PowerPR extends MathPR implements PerPixelFunctionI{
	protected double _exponent = 1.0;
	public void setParameters(double exponent){
		setParamExponent(exponent);
	}
	public void setParamExponent(double exponent){
		_exponent = exponent;
	}
	public double getParamExponent(){
		return _exponent;
	}
	public Data process() {
		ImageDA in = getInputAsImageDA();
		FunctionPR pr = new FunctionPR();
		pr.setParameters(this);
		pr.setInput(in);
		setOutput(pr.process());
		return 	getOutput();
	}
	public float processSample(int x, int y, int band, float value) {
		return (float) Math.pow(value, getParamExponent());
	}

}
